<?php

/**
 * XistsPlan form base class.
 *
 * @package    xists
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseXistsPlanForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'name'           => new sfWidgetFormInput(),
      'ret_percentage' => new sfWidgetFormInput(),
      'ref_percentage' => new sfWidgetFormInput(),
      'lower_amount'   => new sfWidgetFormInput(),
      'upper_amount'   => new sfWidgetFormInput(),
      'period'         => new sfWidgetFormInput(),
      'description'    => new sfWidgetFormInput(),
      'is_activated'   => new sfWidgetFormInputCheckbox(),
      'created_at'     => new sfWidgetFormDateTime(),
      'updated_at'     => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorPropelChoice(array('model' => 'XistsPlan', 'column' => 'id', 'required' => false)),
      'name'           => new sfValidatorString(array('max_length' => 255)),
      'ret_percentage' => new sfValidatorNumber(),
      'ref_percentage' => new sfValidatorNumber(),
      'lower_amount'   => new sfValidatorNumber(),
      'upper_amount'   => new sfValidatorNumber(),
      'period'         => new sfValidatorInteger(),
      'description'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'is_activated'   => new sfValidatorBoolean(),
      'created_at'     => new sfValidatorDateTime(array('required' => false)),
      'updated_at'     => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'XistsPlan', 'column' => array('name')))
    );

    $this->widgetSchema->setNameFormat('xists_plan[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'XistsPlan';
  }


}
